﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common
{
    public class Encoder
    {
        public static byte[] Encode(int obj)
        {
            byte[] res= null;
            res=BitConverter.GetBytes(obj);
            return res;
        }
        public static byte[] Encode(string obj)
        {
            byte[] res = null;
            ASCIIEncoding e = new ASCIIEncoding();
            res = e.GetBytes(obj);
            return res;
        }
        public static byte[] Encode(double obj)
        {
            byte[] res = null;
            res = BitConverter.GetBytes(obj);
            return res;
        }

    }
}
